import {Form, Input, message, Modal} from 'antd';
import ProForm, {ProFormDigit, ProFormText} from "@ant-design/pro-form";
import {PutEdit,getEditInfo} from "@/services/ant-design-pro/order";
import {useEffect, useState} from "react";
import {putEdit} from "@/services/ant-design-pro/FinancialOperation";


const OrderEditModal = (props) => {
	const {visible,setVisible,data,editRefresh} = props;
	const [form] = Form.useForm()
	return (
		<Modal
			visible={ visible  }
			width={600}
			onCancel={()=>{ setVisible(false) }}
			title="编辑"
			onOk={()=>{

					form.validateFields().then( async value => {
						editRefresh()
						await putEdit(data.id, {...value})
						message.success('成功修改!')
						setTimeout(() => {
							setVisible(false)
						},800)

					})
			}}
		>
			{
				<ProForm
					form={form}
					submitter={false}
					initialValues={data}
				>
					<ProFormText  label="姓名:" name="real_name"/>
					<ProFormDigit  width="sm" name="extract_price" label="提现金额:"/>
					<ProFormText  label="微信号:" name="wechat_code"/>
					<Form.Item name="remarks" label="备注：" >
						<Input.TextArea showCount={true} placeholder="请输入备注" maxLength={200}/>
					</Form.Item>
				</ProForm>

			}

		</Modal>
	);
};

export default OrderEditModal;













































































































